home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
ARGO
/
SUPPORT
/
NEWSCLEAN.SPK
/
!NewsClean
/
!RunImage
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1996-09-23
|
7KB
|
293 lines
NewsAgent cleaner tool
By Rich Goodwin
" at line ";
Task$="News Cleaner"
'Purpose$="wipe data from NewsAgent"
%Author$=
(169)+" Richard Goodwin"
$Version$="1.01 (September 1996)"
inputaccept=
openmain
ReadSubs
numberofgroups$=
(groups)
AlterIcons("Parity in group numbers - continue?",2)
AlterIcons("Warning: discrepancy in groups - continue?",2)
inputaccept=
quit
AlterIcons("Exiting NewsAgent Cleaner...",2)
>T+50:
$(block%)="TASK"
"Wimp_CloseDown",taskhandle,!block%
quit=0
error=0
group$(500,6)
block% 256
menublock% 256
"Wimp_Initialise",200,&4B534154,Task$
,taskhandle
"Wimp_OpenTemplate",,"NewsClean:Templates"
"Wimp_LoadTemplate",,,,,,"Info"
,templen,worklen
info templen,infowork worklen
"Wimp_LoadTemplate",,info,infowork,infowork+worklen,-1,"Info",0
"Wimp_LoadTemplate",,,,,,"Main"
,templen,worklen
main templen,mainwork worklen
"Wimp_LoadTemplate",,main,mainwork,mainwork+worklen,-1,"Main",0
"Wimp_LoadTemplate",,,,,,"Characters"
,templen,worklen
"Wimp_CloseTemplate"
"Wimp_CreateWindow",,info
infohandle
"Wimp_CreateWindow",,main
mainhandle
version
iconbar
iconbar
!block%=-1
block%!4=0
block%!8=0
block%!12=68
block%!16=68
block%!20=&201A
$(block%+24)="!newsclean"
"Wimp_CreateIcon",,block%
iconbarhandle
version
!block%=infohandle
block%!4=1
"Wimp_GetIconState",,block%
$(block%!28)=Task$
!block%=infohandle
block%!4=2
"Wimp_GetIconState",,block%
$(block%!28)=Purpose$
!block%=infohandle
block%!4=3
"Wimp_GetIconState",,block%
$(block%!28)=Author$
!block%=infohandle
block%!4=4
"Wimp_GetIconState",,block%
$(block%!28)=Version$
makeiconmenu(X)
$(menublock%)=Task$
menublock%!12=&00070207
menublock%!16=182
menublock%!20=44
menublock%!24=0
menublock%!28=2
menublock%!32=infohandle
menublock%!36=&7000001
$(menublock%+40)="Info"
menublock%!52=&80
menublock%!56=-1
menublock%!60=&7000001
$(menublock%+64)="Quit"
"Wimp_CreateMenu",,menublock%,X,200
openmain
!block%=mainhandle
"Wimp_GetWindowState",,block%
block%!28=-1
"Wimp_OpenWindow",,block%
"Wimp_Poll",0,block%
reason,handle
reason
1 :
"Wimp_RedrawWindow",,block%
2 :
"Wimp_OpenWindow",,block%
3 :
"Wimp_CloseWindow",,block%
6 :
mouseclick(block%)
9 :
menuselect(block%)
17,18 :
message(block%)
mouseclick(bl)
bl!12=-2
oniconbar
bl!12=mainhandle
ClickOnMain
oniconbar
bl!8=2
bl!16=iconbarhandle
makeiconmenu(!bl-64)
bl!8=1
bl!16=iconbarhandle
openmain
message(bl)
bl!16
0 : quit=-1
&502:
menuselect(bl)
!bl
1: quit=-1
zero(number%)
number%<=9
number%>=0
="0"
ClickOnMain
temp$, icon%
inputaccept=
icon%=bl!16
IF icon%>=0 AND icon%<=11 THEN temp$=ircmacro$(icon%+1)
icon%=4 quit=
icon%=3
inputaccept=
inputaccept=
:icon%=0:
operate
icon%=3
inputaccept=2
inputaccept=
operate2:quit=
help$
block%!32
-2:help$="This is the "+Task$+" icon.|MIt allows "+Purpose$+".|M"
infohandle:help$=Task$+": Version "+Version$+"|M"+Author$+"|M"
help$<>""
block%!12=block%!8
block%!16=&503
$(block%+20)=help$+
!block%=(25+
help$)
"Wimp_SendMessage",17,block%,block%!4,0
GetFileType
"OS_File",5,name$
,,filetype%
&filetype%=(filetype%
&FFF00)>>>8
GetFileInfo
pos%,q$,noextension$
pos%=
(name$):file$=""
name$,pos%,1)
pos%-=1
q$<>"."
file$=q$+file$
q$="."
noextension$="":pos%=0
pos%+=1
file$,pos%,1)
q$<>"/" noextension$+=q$
q$="/"
pos%>=
(file$)
file$=noextension$
RedrawWindows
"Wimp_ForceRedraw",-1,-1000,-1000,6000,6000
ReadSubs
>inputfile$="<VTiInternet$Dir>.Apps.News.!NewsAgent.Groups"
"OS_File",5,inputfile$
check%
check%=0 quit=
"Copy "+inputfile$+" NewsClean:Backup ~A ~C ~D F ~N ~P Q ~R S ~T ~V"
fileopen=
inputfile$
#fileopen:
" at line ";
newsversion$=""
char=
#fileopen
char<>10
newsversion$=newsversion$+
(char)
char=10
numberofgroups$=""
char=
#fileopen
char<>10
numberofgroups$=numberofgroups$+
(char)
char=10
groups=0
fullgroup$=""
char=
#fileopen
char$=
(char)
char<>10
fullgroup$=fullgroup$+char$
char=10
fullgroup$<>""
groups+=1:
AddAGroup(fullgroup$)
#fileopen
#fileopen
" at line ";
AddAGroup(fullgroup$)
group$(groups,1)=""
counter=0
loop=1
counter+=1
" char$=
fullgroup$,counter,1)
(char$)<>32
group$(groups,loop)=group$(groups,loop)+char$
(char$)=32
counter+=1
% letter=
fullgroup$,counter,1))
letter<>10
group$(groups,6)=group$(groups,6)+
(letter)
counter=
(fullgroup$)
AlterIcons(numberofgroups$,5)
AlterIcons(
(groups),1)
AlterIcons(text$,iconnumber)
!block%=mainhandle
block%!4=iconnumber
"Wimp_GetIconState",,block%
$(block%!28)=text$
block%!8=0:block%!12=0
"Wimp_SetIconState",,block%
operate
AlterIcons("Wiping articles",2)
"XOS_CLI","WIPE <VTiInternet$Dir>.Apps.News.!NewsAgent.Articles ~C F R ~V"
"XOS_CLI","CDIR <VTiInternet$Dir>.Apps.News.!NewsAgent.Articles"
AlterIcons("Wiping groups info",2)
"XOS_CLI","COPY <VTiInternet$Dir>.Apps.News.!NewsAgent.Group.Index NewsClean:Index ~A ~C ~D F ~N ~P Q ~R S ~T ~V"
"XOS_CLI","WIPE <VTiInternet$Dir>.Apps.News.!NewsAgent.Group ~C F R ~V"
"XOS_CLI","CDIR <VTiInternet$Dir>.Apps.News.!NewsAgent.Group"
"XOS_CLI","CDIR <VTiInternet$Dir>.Apps.News.!NewsAgent.Group.0"
"XOS_CLI","COPY NewsClean:Index <VTiInternet$Dir>.Apps.News.!NewsAgent.Group.Index ~A ~C ~D F ~N ~P Q ~R S ~T ~V"
"XOS_CLI","WIPE NewsClean:Index ~C F R ~V"
AlterIcons("Recreating subscription file",2)
groups=0
=fileout=
"<VTiInternet$Dir>.Apps.News.!NewsAgent.Groups"
tofile(newsversion$+
(10))
tofile(
(groups)+
(10))
loop=1
groups
tofile("0 ")
tofile(group$(loop,2)+" ")
tofile("0 ")
tofile(group$(loop,4)+" ")
tofile(group$(loop,5)+" ")
tofile(group$(loop,6)+
(10))
#fileout
inputaccept=2
AlterIcons("Wipe unprocessed news?",2)
operate2
"XOS_CLI","WIPE <VTiInternet$Dir>.Apps.News.News ~C F R ~V"
"XOS_CLI","WIPE <VTiInternet$Dir>.Apps.News.!NewsAgent.NewsCopy ~C F R ~V"
"XOS_CLI","WIPE <VTiInternet$Dir>.Apps.News.!NewsAgent.OffCopy ~C F R ~V"
tofile(tofile$)
output
tofile$=""
pos%=1
(tofile$)
output=
tofile$,pos%,1)
#fileopen,output